from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField
from wtforms.validators import DataRequired, Length


message_add_id = 'add_message'
class MessageForm(FlaskForm):
    nickname = StringField("昵称", validators=[DataRequired(message="昵称不能为空."),
                                             Length(max=30,message="昵称长度不能超过30")])
    message_submitted = TextAreaField("留言", validators=[DataRequired("内容不能为空."),
                                                        Length(max=510, message="内容长度不能超过520.")])
    uuid = StringField("uuid")